import request from "./request.js"

//发送远程操作指令
export function sendCommand(params) {
  return request(
    '/device/device/sendCommand', 'get', params)
}

//远程指令自定义指令值列表
export function listDeviceModelNextCommand(params) {
  return request(
    '/device/deviceModel/listDeviceModelNextCommand', 'get', params)
}
//远程指令自定义指令值发送
export function sendParameterCommand(params) {
  return request(
    '/device/device/sendParameterCommand', 'post', params)
}

// 发送短信验证码
export function sendCommandSms(params) {
  return request(
    '/admin/mobile/sendDeviceCommandSms', 'post', params)
}

// 验证短信
export function verifyCommandSms(params) {
  return request(
    '/admin/mobile/verifySmsCode', 'post', params)
}

// 获取状态
export function queryStatus(params) {
  return request(
    '/device/device/getSendCommandRecord', 'get', params)
}
// 指令操作记录
export function commadHistoryList(params) {
  return request(
    '/device/device/listSendCommandRecord', 'get', params)
}

// 查询已关联的联动设备
export function queryLinked(params) {
  return request(
    '/device/device/getLinkDevice', 'get', params)
}


// 查询可关联列表
export function queryLinkDevices(params) {
  return request(
    '/device/device/listControlleDevice', 'get', params)
}

// 联动关联操作
export function linkDevice(params) {
  return request(
    '/device/device/addControlleDevice', 'post', params)
}

export function pageList(params) {
  return request(
    '/device/device/listDevice', 'get', params)
}
//根据单位获取建筑树
export function buildList(params) {
  return request(
    '/device/building/tree', 'get', params)
}
//建筑树
export function buildListNew(params) {
  return request(
    '/device/building/treeByDevice', 'get', params)
}
//厂商系列型号
export function mtmList(params) {
  return request(
    '/device/deviceModel/getManufacturerTypeModel', 'get', params)
}

//删除接口
export function delObj(params) {
  return request(
    '/device/device/batchDeleteDevice', 'post', params)
}

//添加设备
export function addObj(params) {
  return request(
    '/device/device/addDevice', 'post', params)
}
//查询设备
export function viewObj(id) {
  return request(
    '/device/device/' + id, 'get', params) 
}
// 修改设备
export function updateObj(params) {
  return request(
    '/device/device/updateDevice', 'put', params)
}
//直接修改设备平面图标记
export function updateImgObj(params) {
  return request(
    '/device/device/updateDeviceMark', 'post', params)
}
//直接修改视频平面图标记
export function updateImgVideo(params) {
  return request(
    '/video/videodevice/updateVideoDeviceMark', 'post', params)
}

//所选楼层图片
export function floorImage(params) {
  return request(
    '/device/buildingPlan/getBuildingPlan', 'get', params)
}


// 所属消防主机
export function fireEngineList(params) {
  return request(
    '/device/fireMainEngine/listAllFireMainEngine', 'get', params)
}

//实时数据接口
//测点列表
export function measuringPoints(params) {
  return request(
    '/device/devicePoint/getByDeviceTyeId', 'get', params)
}
//图表数据
export function realTimeCharts(params) {
  return request(
    '/device/realTime/realTimePointData', 'get', params)
}
//处理记录
export function handleRecord(params) {
  return request(
    '/device/deviceAlarmDispose/listDeviceAlarmDispose', 'get', params)
}

//设备关联规则
export function alarmRuleList(params) {
  return request(
    '/device/ruleStrategy/findDeviceRulesPage', 'get', params)
}
// 报警规则删除
export function delRuleObj(params) {
  return request(
    '/device/ruleStrategy/deleteByIds', 'get', params)
}


// 获取所有视频列表
export function getVideoList(params) {
  return request(
    '/video/videodevice/getVideoDeviceList', 'get', params)
}

//充电记录
export function listChargeRecord(params) {
  return request(
    '/device/chargingPile/listChargeRecord', 'get', params)
}

//指令说明列表
export function listDeviceCommandDesc(params) {
  return request(
    '/device/deviceCommand/listDeviceCommandDesc', 'get', params)
}

//更新指令说明
export function updateDeviceCommandDesc(params) {
  return request(
    '/device/deviceCommand/updateDeviceCommandDesc', 'post', params)
}

//获取远程操控授权剩余次数
export function getDeptSet(params) {
  return request(
    '/device/device/getDeptSet', 'get', params)
}

//远程操作密码校验
export function verifyPassword(params) {
  return request(
    '/admin/user/verifyPassword', 'post', params)
}


//重置远程操控授权校验次数
export function resetVerifyNum(params) {
  return request(
    '/device/fireMainEngine/resetVerifyNum', 'get', params)
}

//减少远程操控授权校验次数
export function reduceVerifyNum(params) {
  return request(
    '/device/fireMainEngine/reduceVerifyNum', 'get', params)
}


//获取当前报警规则触发条件列表
export function listAlarmRuleByDeviceType(params) {
  return request(
    '/device/deptAlarmRule/listAlarmRuleByDeviceType', 'get', params)
}

//获取当前报警规则-设备联动列表
export function listTriggerLinkDevice(params) {
  return request(
    '/device/deptAlarmRule/listTriggerLinkDevice', 'get', params)
}


//获取执行设备Table列表
export function listDeviceByDeviceModel(params) {
  return request(
    '/device/device/listDeviceByDeviceModel', 'get', params)
}


//更新执行设备
export function updateDeviceDeptAlarmTrigger(params) {
  return request(
    '/device/deptAlarmRule/updateDeviceDeptAlarmTrigger', 'post', params)
}



//获取所有可选规则列表
export function listUnBindAlarmRuleByDeviceType(params) {
  return request(
    '/device/deptAlarmRule/listUnBindAlarmRuleByDeviceType', 'get', params)
}


//添加规则
export function addDeviceDeptRule(params) {
  return request(
    '/device/deptAlarmRule/addDeviceDeptRule', 'post', params)
}

//删除当前规则
export function deleteDeviceDeptRule(params) {
  return request(
    '/device/deptAlarmRule/deleteDeviceDeptRule', 'get', params)
}


//获取消防主机时用传和主机联动列表
export function listFireMainAndUserCode(params) {
  return request(
    '/device/fireMain/listFireMainAndUserCode', 'get', params)
}


//获取消防主机时用传和主机联动列表
export function listAllFireMainType(params) {
  return request(
    '/device/fireMain/listAllFireMainType', 'get', params)
}


//报警历史列表
export function listDeviceAlarmByDeviceId(params) {
  return request(
    '/device/deviceAlarmDispose/listDeviceAlarmByDeviceId', 'get', params)
}


//报警历史列表
export function listDevicePointData(params) {
  return request(
    '/device/devicePoint/listDevicePointData', 'get', params)
}


//设备列表导出
export function exportListDevice(params) {
  return request(
    '/device/device/exportListDevice', 'get', params)
}
//获取剩余电量和卡号到期时间
export function getElectric(params) {
  return request(
    '/device/device/getElectric', 'get', params)
}
